<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="Content-Style-Type" content="text/css">
<title></title>
<meta name="Generator" content="Cocoa HTML Writer">
<meta name="CocoaVersion" content="949.54">
<style type="text/css">
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica}
p.p2 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; min-height: 14.0px}
p.p3 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; color: #902f20}
p.p4 {margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco; min-height: 12.0px}
p.p5 {margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco; color: #bf0000}
p.p6 {margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco; color: #000000}
p.p7 {margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco; color: #000000; min-height: 12.0px}
span.s1 {font: 18.0px Helvetica}
span.s2 {color: #083aec}
span.s3 {color: #0000ff}
span.s4 {text-decoration: underline ; color: #000000}
span.s5 {text-decoration: underline}
span.s6 {color: #0000bf}
span.Apple-tab-span {white-space:pre}
</style>
</head>
<body>
<p class="p1"><span class="s1"><b>RedAccelerometer</b></span><b><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>for iphone sc compatibility</b></p>
<p class="p2"><br></p>
<p class="p1"><b>inherits from: </b><a href="SC://UGen"><span class="s2"><b>UGen</b></span></a></p>
<p class="p2"><br></p>
<p class="p1">There are 3 classes RedAccelerometerX, RedAccelerometerY, RedAccelerometerZ. One for each axis.</p>
<p class="p2"><br></p>
<p class="p1">req. <a href="RedInfoSms.html"><span class="s3">RedInfoSms</span></a> ugen from the RedInfo ugen package (mac osx only).</p>
<p class="p3"><span class="s4">http:</span><span class="s5">//www.fredrikolofsson.com/pages/code-sc.html</span></p>
<p class="p2"><br></p>
<p class="p1"><b><span class="Apple-tab-span">	</span>*kr(minval, maxval, warp, lag)</b></p>
<p class="p2"><b><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span></b></p>
<p class="p4"><br></p>
<p class="p4"><br></p>
<p class="p5">//--</p>
<p class="p6">s.boot;</p>
<p class="p7"><br></p>
<p class="p6">(</p>
<p class="p6">{</p>
<p class="p6"><span class="s6">var</span> x= <span class="s6">RedAccelerometerX</span>.kr(1, 499, 1).clip(1, 499);</p>
<p class="p6"><span class="s6">var</span> y= <span class="s6">RedAccelerometerY</span>.kr(500, 999, 1).clip(500, 999);</p>
<p class="p6"><span class="s6">var</span> z= <span class="s6">RedAccelerometerZ</span>.kr(0, 20, 0).clip(0, 20);</p>
<p class="p6"><span class="s6">Splay</span>.ar({<span class="s6">Gendy1</span>.ar(minfreq:x, maxfreq:y, durscale:z)}.dup(12).sum, 1, 0.25);</p>
<p class="p6">}.play</p>
<p class="p6">)</p>
<p class="p5">//to run the example on iphone sc, replace all 'RedAccelerometer' with 'Accelerometer'</p>
</body>
</html>
